package axdoc.rule;

import java.util.HashMap;
import java.util.Map;

import com.alibaba.fastjson.JSONObject;

public class MessageHandleFacotry {

	private Map<Integer, MessageHandle> handles = new HashMap<Integer, MessageHandle>();

	public void done(String json) {
		JSONObject obj = JSONObject.parseObject(json);
		Integer type = obj.getInteger("type");
		handles.get(type).handle(obj);
	}

	public Map<Integer, MessageHandle> getHandles() {
		return handles;
	}

	public void setHandles(Map<Integer, MessageHandle> handles) {
		this.handles = handles;
	}

}
